﻿//using System;
//using System.Collections.Generic;
//using System.IO;
//using System.Linq;
//using System.Text;
//using System.Xml;

//using Microsoft.VisualStudio.TestTools.UnitTesting;

//using Pibby.Core.Rss;

//namespace Pibby.Core.Tests
//{
//    [TestClass]
//    public class ItemTests
//    {
//        [TestMethod]
//        public void NewItem_FromXml_InitialisesProperties()
//        {
//            StringBuilder builder = new StringBuilder ();

//            builder.Append ("<item>");
//            builder.Append ("<title>Getting into the Spirit of Things</title>");
//            builder.Append ("<link>http://monstertalk.skeptic.com/index.php?post_id=588743#</link>");
//            builder.Append ("<description><![CDATA[<p>What does neuroscience have to say about the possibility of consciousness or mind existing outside the body &mdash; or continuing on after the body has died? This episode&rsquo;s guest is neurologist Dr. Steven Novella (veteran of on-site ghost investigations, and host of the Skeptics&rsquo; Guide to the Universe podcast, who shares his insights on brains, minds, and specters from beyond the grave.</p>");
//            builder.Append ("<p><a href=\"http://www.skeptic.com/podcasts/monstertalk/10-03-03/\">READ full episode notes</a></p>]]></description>");
//            builder.Append ("<category>podcasts</category>");
//            builder.Append ("<pubDate>Wed, 3 Mar 2010 08:00:00 GMT</pubDate>");
//            builder.Append ("<guid isPermaLink=\"true\">1234567890</guid>");
//            builder.Append ("<author>doctoratlantis@gmail.com (Blake Smith)</author>");
//            builder.Append ("<enclosure url=\"http://media.libsyn.com/media/skeptic/013_Monstertalk.mp3\" length=\"48076633\" type=\"audio/mpeg\"/>");
//            //builder.Append ("<itunes:duration>01:06:46</itunes:duration>");
//            //builder.Append ("<itunes:author>Blake Smith, Benjamin Radford and Dr. Karen Stollznow</itunes:author>");
//            //builder.Append ("<itunes:explicit>No</itunes:explicit>");
//            builder.Append ("</item>");

//            using (TextReader reader = new StringReader(builder.ToString ()))
//            {
//                XmlReaderSettings settings = new XmlReaderSettings();
//                settings.IgnoreComments = true;
//                settings.IgnoreProcessingInstructions = true;
//                settings.IgnoreWhitespace = true;

//                using (XmlReader xmlReader = XmlTextReader.Create(reader, settings))
//                {
//                    xmlReader.Read();

//                    Assert.AreEqual(XmlNodeType.Element, xmlReader.NodeType, "First element must be item");
//                    Assert.AreEqual("item", xmlReader.Name);

//                    Item item = Item.Create(xmlReader);

//                    Assert.IsNotNull(item);

//                    Assert.AreEqual("Getting into the Spirit of Things", item.Title);
//                    //Assert.AreEqual("01:06:46", item.Duration);
//                    Assert.AreEqual("1234567890", item.Id);
//                    Assert.AreEqual("http://monstertalk.skeptic.com/index.php?post_id=588743#", item.Link);
//                    Assert.AreEqual(new DateTime (2010, 3, 3, 8, 0, 0), item.PublicationDate);
//                    Assert.AreEqual("<p>What does neuroscience have to say about the possibility of consciousness or mind existing outside the body &mdash; or continuing on after the body has died? This episode&rsquo;s guest is neurologist Dr. Steven Novella (veteran of on-site ghost investigations, and host of the Skeptics&rsquo; Guide to the Universe podcast, who shares his insights on brains, minds, and specters from beyond the grave.</p><p><a href=\"http://www.skeptic.com/podcasts/monstertalk/10-03-03/\">READ full episode notes</a></p>", item.Description);
//                }
//            }


//        }
//    }
//}
